package com.bloveoacom.weichi.activity;

import android.os.Bundle;
import android.view.View;

import com.bloveoacom.base.BaseActivity;
import com.bloveoacom.base.BaseFragment;
import com.bloveoacom.weichi.R;
import com.bloveoacom.weichi.adapter.AllFragmentPagerAdapter;
import com.bloveoacom.weichi.fragment.PostListFragment;
import com.bloveoacom.weichi.fragment.PublishListFragment;
import com.bloveoacom.weichi.fragment.WaitChecktFragment;
import com.bloveoacom.weight.LlkjToolBar;
import com.bloveoacom.weight.NoScrollViewPager;
import com.flyco.tablayout.SlidingTabLayout;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import butterknife.BindView;

/**
 * author: yjl
 * e-mail: 1271901673@qq.com
 * time  : 2018/9/21
 * desc  :
 */
public class ContentActivity extends BaseActivity {
    @BindView(R.id.title_bar)
    LlkjToolBar mToolbar;
    @BindView(R.id.segment_tab2)
    SlidingTabLayout segmentTab;
    @BindView(R.id.fl_content2)
    NoScrollViewPager fl_content2;
    private final String[] mTitles = {"已发布", "待群审"};

    @Override
    public int getLayoutResId() {
        return R.layout.fragment_tablayout;
    }

    @Override
    protected View getViewSetTB() {
        return mToolbar;
    }

    @Override
    public void initView() {
        mToolbar.setToolBar("内容",
                true, "", R.drawable.ic_back, false, "", LlkjToolBar.isNull);
    }

    @Override
    public void initData() {
        List<BaseFragment> list = new ArrayList<>();
        list.add(PublishListFragment.newInstance());
        list.add(WaitChecktFragment.newInstance());
        fl_content2.setOffscreenPageLimit(2);
        fl_content2.setAdapter(new AllFragmentPagerAdapter(getSupportFragmentManager(), list, Arrays.asList(mTitles)));
        segmentTab.setViewPager(fl_content2);
    }

    @Override
    public void getBundleExtras(Bundle extras) {

    }

    @Override
    public void initListener() {

    }
}
